//
//  NewDetailsSecondModel.m
//  项目A --半糖
//
//  Created by romana on 16/5/24.
//  Copyright © 2016年 romana. All rights reserved.
//

#import "NewDetailsSecondModel.h"
#import "NewDetailsPicModel.h"
#import "NewDetailsLikeListModel.h"

@implementation NewDetailsSecondModel

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    if ([key isEqualToString:@"pic"]) {
        self.PicArray = value;
        
    }
    if ([key isEqualToString:@"likes_list"]) {
        self.LikeListArray = value;
    }

}

-(void)setPicArray:(NSMutableArray *)PicArray{

    _PicArray = PicArray;
    NSMutableArray *array = [NSMutableArray array];
    for (NSDictionary *dic in _PicArray) {
        NewDetailsPicModel *model = [[NewDetailsPicModel alloc] init];
        [model setValuesForKeysWithDictionary:dic];
        [array addObject:model];
        NSLog(@"picURL = %@",model.picURL);
    }

    _PicArray = [NSMutableArray arrayWithArray:array];
    

}


-(void)setLikeListArray:(NSMutableArray *)LikeListArray{

    _LikeListArray = LikeListArray;
    NSMutableArray *array = [NSMutableArray array];
    for (NSDictionary *dic in _LikeListArray) {
        NewDetailsLikeListModel *model = [[NewDetailsLikeListModel alloc] init];
        [model setValuesForKeysWithDictionary:dic];
        [array addObject:model];
    }


    _LikeListArray = [NSMutableArray arrayWithArray:array];


}

@end
